<?php
namespace Admin\Controller;
class PictureController extends BaceController{
    public function dropzone() {
       var_dump($_FILES);
        if ($_POST){
           $re=D('Adve');
           $cre=$re->create();
            $arr=$re->add();
               if ($arr){
                       //保存图片
                       $upload=new \Think\Upload();
            		   $upload->autoSub=false;
            		   $upload->mimes=array('image/png','image/gif','image/jpeg','image/jpg');
            		   $upload->rootPath="./Public/Upload/";
            		   $imageArr=$upload->upload();          
                       //var_dump($upload);
                      /*  $adve=M('Adve');
                       foreach ($imageArr as $v) {
                   
                       } */
                   
                   
               }
           
           
       /*  if($imageArr){
            $_POST['image']=$imageArr['upload']['savename'];
        }
        //产生数据，写数据库表
        $re=M("Brand")->data($_POST)->add();
        if($re){
            $this->success("添加成功",U("Brand/oper"));
        }else{
            $this->error("添加失败",U('Brand/add'));
        }
        } */
//保存图片 
      /*   $adve=D('Adve');
        $re=$adve->create();
        if ($re){
            $_POST['updated_time']=time();
           $arr=$adve->data($_POST)->add();
        }
     
        if ($arr){
        $upload= new \Think\Upload();
        $upload->mimes=array('png','gif','jpeg','jpg');//允许上传类型
        $upload->autoSub=false;//不让它上传时保存在子目录
        $upload->rootPath="./Public/";//文件上传的保存路径
        $upload->savePath="Upload/Product/";
        $image=$upload->upload();
        }  */
           }
        $this->display();
    }
}